import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Sidebar from '@/components/Sidebar'
import Main from '../components/Main'
import login from '@/page/login'
import home from '@/page/home'
import adminList from '@/page/adminList'
import book from '@/page/book'
import contentList from '@/page/contentList'
import approve from '@/page/approve'
import publish from '@/page/publish'
import listPublish from '@/page/listPublish'
Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            component: login
        },
        {
            path: '/manage',
            component: Sidebar,
            children: [
                {
                    path: '',
                    component: home,
                    meta: [],
                },

                {
                    path: '/adminList',
                    component: adminList,
                    meta: ['系统维护', '管理员管理']
                },
                {
                    path: '/contentList',
                    component: contentList,
                    meta: ['系统维护', '文章管理']
                },
                {
                    path: '/approve',
                    component: approve,
                    meta: ['task', '审核']
                },

                {
                    path: '/publish',
                    component: approve,
                    meta: ['task', '审核']
                },
                {
                    path: '/listPublish',
                    component: approve,
                    meta: ['task', '审核']
                },
                {
                    path: '/book',
                    component: book,
                    meta: ['系统维护', '书籍']
                }
            ]
    }
  ]
})
